package yh;

/**
 * 已知一个数组如下String[] arr=new String[]{"AA","BB","CC","DD","EE"};
 * 反转arr数组得到如下结果String[] arr=new String[]{"EE","DD","CC","BB","AA"};
 */
public class ArrayTest4 {
    public static void main(String[] args) {
        String[] arr=new String[]{"AA","BB","CC","DD","EE"};
        for (int i = 0; i <arr.length/2 ; i++) {
            String str=arr[i];
            arr[i]=arr[arr.length-i-1];
            arr[arr.length-i-1]=str;
        }
        for (int i = 0; i <arr.length ; i++) {
            System.out.println(arr[i]);
        }
    }
}
